package 华为测试;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.Scanner;

/**
 * Created by hest0 on 2017/7/7.
 */

/**
 * 4
 * AA BB
 * BB CC
 * CC DD
 * DD CC
 * BB DD
 * <p>
 * 4
 * AA BB
 * BB CC
 * CC DD
 * AA CC
 * BB DD
 **/
public class 华为第三题 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNext()) {
            int n = Integer.parseInt(sc.nextLine());

            ArrayList<String> list = new ArrayList<>();
            for (int i = 0; i < n + 1; i++) {
                String line = sc.nextLine();
                if (i == 0) {
                    list.add(line);
                } else {
                    for (int j = 0; j < list.size(); j++) {
                        String s = list.get(j);
                        String[] a = s.trim().split("\\s+");
                        String last = a[a.length - 1];

                        String[] b = line.trim().split("\\s+");
                        String first = b[0];

                        if (last.equals(first)) {
                            String newStr = s + line.substring(first.length());
                            list.add(newStr);
                        }
                    }
                }
            }

            String res = null;
            for (int i = 0; i < list.size(); i++) {
                String s = list.get(i);//A B C D A
                String[] a = s.trim().split("\\s+");
                HashSet<String> set = new HashSet<>();
                for (int j = 0; j < a.length; j++) {
                    set.add(a[j]);
                }
                if (a.length != set.size()) {
                    res = "T";
                }
            }

            res = "T".equals(res) ? "T" : "F";
            System.out.println(res);
        }
        sc.close();
    }

}
